package com.hngd.day23;

import android.os.Bundle;
import android.app.Activity;
import android.view.View;
import android.widget.LinearLayout;

public class MainActivity extends Activity {
	private LinearLayout main_linearLayout = null;
	
	public void blue(View v){
		main_linearLayout.setBackgroundColor(getResources().getColor(android.R.color.holo_blue_bright));
		//Toast.makeText(MainActivity.this, "点击了按钮1", 1).show();
	}
	
	public void orange(View v){
		
		main_linearLayout.setBackgroundColor(getResources().getColor(android.R.color.holo_orange_dark));
	}
		
	
    @Override
    protected void onCreate(Bundle savedInstanceState) {
    	
        super.onCreate(savedInstanceState);
       
        //设置xml的视图布局
        setContentView(R.layout.activity_main);
        main_linearLayout = (LinearLayout) this.findViewById(R.id.main_linearLayout);
    
       
        
        
        /*//纯java代码书写视图布局
        LinearLayout layout = new LinearLayout(this);
        layout.setLayoutParams(new LayoutParams(La));*/
    }


  
    
}
